class ParamsTypeError(Exception):
	pass

#for循环
def feibo_for(x):
	try:
		a = 0
		b = 1
		for i in range(x):
			print(a)
			a,b = b,a+b
		return a
	except Exception as e:
		raise ParamsTypeError("参数类型错误")
feibo_for(10)


#while循环
def feibo_while(x):
	try:
		a = 0
		b = 1
		while True:
			print(a)
			a,b = b,a+b
			x -= 1
			if x == 0:
				break
	except Exception as e:
		raise ParamsTypeError("参数类型错误")
	return a
feibo_while(10)



